#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    button = new QPushButton(this);

    button->setText("hello world");
    connect(button, &QPushButton::clicked, this, &Widget::handlerClicked);

}

void Widget::handlerClicked()
{
    if(button->text() == "hello world") {
        button->setText("hello qt");
    } else {
        button->setText("hello world");
    }
}

Widget::~Widget()
{
    delete ui;
}

